package com.czd.support.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.model.Helpcenter;
import com.czd.support.model.TreeModel;

/**
 * @Description 帮助中心业务类
 * @Author caoren
 * @Date 2015/05/31
 * @Version 1.0
 */
@Service
public class HelpcenterService extends BaseService<Helpcenter>{
	public Paginate queryForPage(Helpcenter helpcenter) {
		return this.queryForPaginate(sqlId("queryForPage"), helpcenter);
	}
	
	public List<TreeModel> createChannelTree() {
		return this.queryDao.getSqlSession().selectList(sqlId("createChannelTree"));
	}
	
	public List<Helpcenter> getHelpcentersByParent(int level){
		return this.selectList(sqlId("getHelpcentersByParent"), level);
	}
	
	public Helpcenter getByCatetory(int catetory){
		return this.selectOne(sqlId("getByCatetory"), catetory);
	}
	
	public boolean insert(Helpcenter helpcenter){
		return this.insert(sqlId("insert"), helpcenter);
	}
	
	public boolean update(Helpcenter helpcenter){
		return this.update(sqlId("update"), helpcenter);
	}
}
